function Weapon(){
	var self=this;
	self.body=document.createElement("div")
	self.init=function(){
		self.body.className="weapon"
		ge.body.appendChild(self.body)
		self.left(ge.width()/2-self.width()/2)
		self.top(-self.height())
		return self;
	}
	self.move=function(){
		var degree = 0;
		var a=Math.random()
		self.timer = setInterval(function() {
			if(!GameEngine.pause){
				self.body.style.top = self.top() + 10 + "px"
	            var radian = degree * (Math.PI/180);
	            self.body.style.left = (ge.width()/2-self.width()/2) * (Math.sin(radian)+1)+"px";
	            if(a>0.5){
		            degree -= 10;
	            }else{
	            	degree +=10
	            }
				if(self.top() < -self.height()) {
					self.destroy();
					clearInterval(self.timer)
				}
			}
		}, 50)
		return self;
	}
	self.left=function(val){
		if(val!=undefined){
			self.body.style.left=val+"px"
		}else{
			return self.body.offsetLeft
		}
	}
	self.top=function(val){
		if(val!=undefined){
			self.body.style.top=val+"px"
		}else{
			return self.body.offsetTop
		}
	}
	self.height=function(val){
		if(val!=undefined){
			self.body.style.height=val+"px"
		}else{
			return self.body.offsetHeight
		}
	}
	self.width=function(val){
		if(val!=undefined){
			self.body.style.width=val+"px"
		}else{
			return self.body.offsetWidth
		}
	}
	self.destroy = function() {
		//武器
		clearInterval(self.timer)
		ge.weapons.delete(self)
		self.body.remove()
	}
}
